#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	string s;
	cin>>n;
	while(n--)
	{
		cin>>s;
		transform(s.begin(), s.end(), s.begin(), ::tolower);
		if('a' <= s[0] && s[0] <= 'z')
			s[0] -= 'a'-'A';
		cout<<s<<endl;
	}
    return 0;
}

